<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInLeft">
    <div>
        <div class="row">
            <div class="pt10">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>活动信息</h5>
                        </div>
                        <div class="ibox-content clearfix p-t">
                            <div class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">活动名称</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" th:text="${activity['activityName']}"></p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group" th:if="!${#lists.isEmpty(activity['subjectList'])}">
                                    <label class="col-sm-2 control-label">活动范围</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static">限定使用范围-专业/科目：<br/>
                                            <th:block th:if="!${#lists.isEmpty(activity['subjectList'])}">
                                                <span class="fs12 c-4e" th:each="subject,subIndex : ${activity['subjectList']}">
                                                    <th:block th:text="${subject['subjectName']}+'/'"></th:block>
                                                    <th:block th:if="!${#lists.isEmpty(subject['childSubjectList'])}" th:each="child,index : ${subject['childSubjectList']}">
                                                        <th:block th:if="${index.last} == false" th:text="${child['subjectName']}+'/'"></th:block>
                                                        <th:block th:if="${index.last} == true" th:text="${child['subjectName']}"></th:block>
                                                    </th:block>
                                                    <th:block th:if="${#lists.isEmpty(subject['childSubjectList'])}">全部科目</th:block>
                                                    <th:block th:if="${subIndex.last}==false" th:utext="'<br/>'"></th:block>
                                                </span>
                                            </th:block>
                                            <th:block th:if="${#lists.isEmpty(activity['subjectList'])}">
                                                <span class="fs12 c-4e">—</span>
                                            </th:block>
                                        </p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed" th:if="${activity['subjectIds']}!=null and ${activity['subjectIds']}!=''"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">活动类型</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static">
                                            <span th:if="${#strings.contains(activity['activityType'],'1')}">满减</span>
                                            &nbsp;&nbsp;&nbsp;
                                            <span th:if="${#strings.contains(activity['activityType'],'2')}">满赠</span>
                                        </p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">最低消费金额</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static">
                                            <i class="fa fa-cny"></i>
                                            <span th:text="${activity['askAmount']}"></span>
                                        </p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">消减金额</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static">
                                            <i class="fa fa-cny"></i>
                                            <span th:text="${activity['subAmount']}"></span>
                                        </p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">活动时间</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static">
                                            <span th:text="${#strings.substring(activity['beginTime'],0,16)}+'—'+${#strings.substring(activity['endTime'],0,16)}"></span>
                                        </p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group" th:if="${#strings.contains(activity['giftType'],'2')}">
                                    <label class="col-sm-2 control-label">赠品</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static">
                                            <span th:if="${#strings.contains(activity['giftType'],'1')}">课程&nbsp;&nbsp;&nbsp;</span>
                                            <span th:if="${#strings.contains(activity['giftType'],'2')}">优惠券</span>
                                            <span th:if="${#strings.contains(activity['giftType'],'3')}">&nbsp;&nbsp;&nbsp;积分</span>
                                        </p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed" th:if="${#strings.contains(activity['giftType'],'2')}"></div>
                                <div class="form-group" th:if="${#strings.contains(activity['giftType'],'1')}">
                                    <label class="col-sm-2 control-label text-right">赠送课程</label>
                                    <div class="col-sm-9">
                                        <div class="pt10">
                                            <table class="table table-bordered table-hover">
                                                <thead>
                                                <tr>
                                                    <th class="text-center">ID</th>
                                                    <th>课程名称</th>
                                                    <th >价格</th>
                                                </tr>
                                                </thead>
                                                <tbody>
                                                    <tr th:each="course : ${activity['course']}">
                                                        <td class="text-center" th:text="${course['id']}"></td>
                                                        <td th:text="${course['courseName']}"></td>
                                                        <td class="text-center"><span class="c-red" th:text="${course['realPrice']}"></span></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed" th:if="${#strings.contains(activity['giftType'],'1')}"></div>
                                <block th:if="!${#lists.isEmpty(activity['coupons'])}">
                                    <div class="form-group" th:if="${#strings.contains(activity['giftType'],'2')}">
                                        <label class="col-sm-2 control-label text-right">赠送优惠券</label>
                                        <div class="col-sm-9">
                                            <div class="pt10">
                                                <table class="table table-bordered table-hover">
                                                    <thead>
                                                    <tr>
                                                        <th class="text-center">ID</th>
                                                        <th>优惠券名称</th>
                                                        <th>金额、折扣</th>
                                                        <th class="text-center">类型</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    <tr th:each="coupon : ${activity['coupons']}">
                                                        <td class="text-center" th:text="${coupon['id']}"> </td>
                                                        <td th:text="${coupon['title']}"> </td>
                                                        <td><span class="c-red" th:text="${coupon['limitAtion']}"></span></td>
                                                        <td class="text-center">
                                                            <span th:if="${coupon['type']}==1">折扣券</span>
                                                            <span th:if="${coupon['type']}==2">定额券</span>
                                                        </td>
                                                    </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed" th:if="${#strings.contains(activity['giftType'],'2')}"></div>
                                    <div class="form-group" th:if="${#strings.contains(activity['giftType'],'2')}">
                                        <label class="col-sm-2 control-label">总送优惠券数量</label>
                                        <div class="col-sm-10">
                                            <p class="form-control-static" th:text="${#lists.size(activity['coupons'])}*${activity['couponCount']}"></p>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed" th:if="${#strings.contains(activity['giftType'],'2')}"></div>
                                </block>
                                <div class="form-group" th:if="${#strings.contains(activity['giftType'],'3')}">
                                    <label class="col-sm-2 control-label">赠送积分</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" th:text="${activity['integral']}"></p>
                                    </div>
                                </div>
                                <div class="hr-line-dashed" th:if="${#strings.contains(activity['giftType'],'3')}"></div>
                                </c:if>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label text-right">活动页面</label>
                                    <div class="col-sm-8">
                                        <div class="clearfix">
                                            <div class="file-box">
                                                <div class="file" th:if="${activity['imageMap']}!=null">
                                                    <div class="image">
                                                        <input type="hidden" id="imageJson" name="imageJson" th:value="${activity['imageJson']}"/>
                                                        <img alt="image" id="activity-image" th:src="${activity['imageMap']['pcUrlMap']['large']}" class="img-responsive" >
                                                    </div>
                                                    <div class="file-name">
                                                        <p id="file-names" th:text="${activity['imageMap']['fileName']}"></p>
                                                        <small id="create-time" th:text="'添加时间：'+${activity['imageMap']['createTime']}"></small>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">活动描述</label>
                                    <div class="col-sm-10">
                                        <div class="well" th:text="${activity['depict']}">
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">创建人</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" th:text="${activity['createUser']['username']}"></p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<div data-th-replace="layout/head-footer"></div>
<script type="text/javascript" th:src="@{{path}/admin/business/op/activity/activity_info.js?v={v}(path=${staticPath},v=${v})}"> </script>
</body>
</html>
